//
//  LaundryTheOrderDetailsTableViewCell.m
//  BaseFrame
//
//  Created by 吕金状 on 2017/8/17.
//  Copyright © 2017年 com.mxh. All rights reserved.
//

#import "LaundryTheOrderDetailsTableViewCell.h"

@interface LaundryTheOrderDetailsTableViewCell ()

Strong UILabel *timeLabel;
Strong UILabel *titleLabel;
Strong UIView *lineView;

@end

@implementation LaundryTheOrderDetailsTableViewCell

- (id)initWithCellIdentifier:(NSString *)cellID{
    self = [super initWithCellIdentifier:cellID];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        _titleLabel  = [[UILabel alloc]init];
        _titleLabel.font = DEF_FontSize_14;
        _titleLabel.textColor = getColor(textColor);
        [self.contentView addSubview:_titleLabel];
        
        _timeLabel  = [[UILabel alloc]init];
        _timeLabel.font = DEF_FontSize_14;
        _timeLabel.textColor = getColor(textColor);
        [self.contentView addSubview:_timeLabel];
        
        _lineView = [[UIView alloc]init];
        _lineView.backgroundColor = getColor(dividerColor);
        [self.contentView addSubview:_lineView];
        [self layoutFrame];
    }
    return self;
}

- (void)layoutFrame{
    __weak __typeof(self)weakSelf = self;
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20 / WIDTH_5S_SCALE);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
    }];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(- 20 / WIDTH_5S_SCALE);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20 / WIDTH_5S_SCALE);
        make.top.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH - 40 / WIDTH_5S_SCALE, 0.5));
    }];
}

- (void)setModel:(NSDictionary *)model{
    _model = model;
    self.lineView.hidden = YES;
    if (self.indexPath.row != 0) {
        self.lineView.hidden = NO;
    }
    self.titleLabel.text = model[@"title"];
    self.timeLabel.text = model[@"time"];
}


@end
